package j02yichang;

import java.util.Random;

public class J3duogeyichang {
    public static void main(String[] args) {
        Random r = new Random();
        try {
//            if(r.nextInt(10)>5){
//                System.out.println(10/0);
//            }else {
//                int[] arr = {1,3};
//                System.out.println(arr[10000]);
//            }
            //...
            //catch之间互斥
        }catch (ArithmeticException e){
            System.out.println("除数不许为0");
        }catch (ArrayIndexOutOfBoundsException e){
            System.out.println("数组超出索引");
        }catch (Exception e){
            e.printStackTrace();
            System.out.println("其它异常");
        } finally {
            System.out.println("遇到、不遇到异常");
        }


    }
}
